import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopUserFavoriteController } from '../../../controllers';
const uctoominishopUserFavoriteRouter = new Router();
const minishopUserFavoriteController = new uctooMinishopUserFavoriteController();

uctoominishopUserFavoriteRouter.post('/add', requireUser, minishopUserFavoriteController.add);
uctoominishopUserFavoriteRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_user_favorite'), minishopUserFavoriteController.edit);
uctoominishopUserFavoriteRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_user_favorite'), minishopUserFavoriteController.delete);

//For getting minishopUserFavorite with permission control
uctoominishopUserFavoriteRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_user_favorite'), minishopUserFavoriteController.getSingle);
uctoominishopUserFavoriteRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_user_favorite'), minishopUserFavoriteController.getMany);
uctoominishopUserFavoriteRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_user_favorite'), minishopUserFavoriteController.getMany);

//#endregion AutoCreateCode
export default uctoominishopUserFavoriteRouter;
